package com.doubledragon.tiny.aop.daynamicProxy;

import com.doubledragon.tiny.aop.pointcutAdvisor.MethodMatcher;
import org.aopalliance.intercept.MethodInterceptor;

/**
 * Created by dragon
 *
 * 增强器的辅助, 用于封装相关元数据，可以利用它来创建动态代理
 */
public class AdvisedSupport {

    private TargetSource targetSource;//目标类

    // 方法拦截器(它继承自Advice，它的实现类中的invoke方法拦截原始方法，并加入增强逻辑，代理类会调用该方法，这就是动态代理的实现功能。
    // 在spring中表现为@before、@after等)
    private MethodInterceptor methodInterceptor;

    private MethodMatcher methodMatcher;

    public TargetSource getTargetSource() {
        return targetSource;
    }

    public void setTargetSource(TargetSource targetSource) {
        this.targetSource = targetSource;
    }

    public MethodInterceptor getMethodInterceptor() {
        return methodInterceptor;
    }

    public void setMethodInterceptor(MethodInterceptor methodInterceptor) {
        this.methodInterceptor = methodInterceptor;
    }

    public MethodMatcher getMethodMatcher() {
        return methodMatcher;
    }

    public void setMethodMatcher(MethodMatcher methodMatcher) {
        this.methodMatcher = methodMatcher;
    }
}
